<?php
     @session_start();
    include("template/head.php");
  //  include("template/menu_left.php"); 
  	if($user['account_login']=="user"){
		header('location:list_article.php?action=access_denied');
	}  
	$sql = "SELECT * FROM `st_att_monnaie`";
	$obj = new Mysql ();
	$result = mysql_query($sql);
?>
    <div class="container-fluid">
        <div class="row-fluid">
                
        <?php include("template/menu_left.php") ?>                

        <div class="span10" id="content">
            <?php 
						  if ((isset($_GET["action"])) && ($_GET["action"] == "added"))
							{
							echo'
							<div class="alert alert-success col-lg-7" style="margin:10px;">
								Le Devise : <b>'.$_GET['devise'].'</b> est ajoutée avec succés <button type="button" class="close" data-dismiss="alert">&times;</button>
							</div>
							';
							}
						if ((isset($_GET["action"])) && ($_GET["action"] == "addedError"))
							{
							echo'
							<div class="alert alert-danger col-lg-7" style="margin:10px;">
								Cet Devise Existe déja <button type="button" class="close" data-dismiss="alert">&times;</button>
							</div>
							';
							}
			?> 
            <div class="row-fluid">
            <!-- block -->
            <div class="block">
              <div class="navbar navbar-inner block-header">
                <div class="muted pull-left">Liste des devises (<?php  $num = mysql_num_rows($result); echo $num ; ?>)</div>
              	<div class="pull-right">                <a class="btn btn-primary btn-sm" href="add_monnaie.php" style="float:right;width:200px;margin-bottom:20px;" >Nouvelle devise</a></div>
              </div>
              <div class="block-content collapse in">
                <div class="span12">
                    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
                    <thead>
                      <tr>
                        <th>Devise</th>
						<th>Description</th>
				        <th style="width:380px;"></th>
                      </tr>
                    </thead>
                    <tbody>
                       <?php    
                         while($row = mysql_fetch_object($result))
                        {
                        ?>
        
                      <tr class="odd gradeX">
                        <td><?php echo $row->nom_monnaie?></td>
						<td><?php echo $row->description?></td>
                        <td>
                            
                            
                            <a class="btn btn-primary btn-small" href="edit_monnaie.php?action=update&id_monnaie=<?php echo $row->id_monnaie?>"><i class="icon-pencil icon-white"></i></a>
                            
                            <a href="#myModal<?php echo $row->id_monnaie?>" data-toggle="modal"  class="btn btn-danger btn-small"><i class="icon-remove icon-white"></i></a>  
                            
                            <div id="myModal<?php echo $row->id_monnaie?>" class="modal hide">
                                <div class="modal-header">
                                    <button data-dismiss="modal" class="close" type="button">&times;</button>
                                        <p>Voulez-vous supprimer la devise : <strong> <?php echo $row->nom_monnaie ?></strong> </p>
                                    </div>
                                
                                    <div class="modal-footer">
                                        <a class="btn btn-primary" href="submit/gestion_monnaie/edit_delete_monnaie.php?action=delete&id_monnaie=<?php echo $row->id_monnaie?>">Confirmer</a>
                                        <a data-dismiss="modal" class="btn" href="#">Annuler</a>
                                    </div>
                            </div>
                        </td>
                      </tr>
                      <?php
                        }
                      ?>
                    </tbody>
                  </table>
                </div>
                <a class="btn btn-primary btn-sm" href="add_monnaie.php" style="float:right;width:200px;margin:20px;" >Nouvelle devise</a>
              </div>
            </div>
        <!-- /block -->
          </div>
                </div>
            </div>
            <hr>
        </div>
<?php  include("template/footer.php") ; ?>